home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TPL60N14.ARJ / README.DOC < prev    next >
Text File  |  1992-05-07  |  16KB  |  320 lines

  1.      Turbo-Pascal 6.0 Runtime Libary Update - Release 1.4   05-07-1992
  2.  
  3.      This library is a complete replacement for the runtime library that
  4.      came with your Turbo Pascal 6.0 compiler. Due to lots of optimizations,
  5.      programs compiled with this version of TURBO.TPL will be faster.
  6.      This library maintains 99.9% compatibility with the original library.
  7.      Differences are usually due to enhancements and should not cause
  8.      any compatibility problems. Some bugs from the original library
  9.      supplied by Borland have been eliminated, but there can be no guarantee
  10.      that new ones have not crept in. If you discover any bugs, or have
  11.      other comments, please let me know. My email and snail mail addresses
  12.      are given below. Due to the nature of Borland's licensing of the
  13.      TPL source code I am not allowed to distribute the source code of
  14.      my enhanced library, so I can only provide the binary.
  15.  
  16.      Original library code is Copyright (C) 1983,91 Borland International
  17.  
  18.      New / additional library code is Copyright (C) 1988-1992
  19.      Norbert Juffa, Wielandtstr. 14, 7500 Karlsruhe 1, Germany
  20.      Internet: S_JUFFA@IRAVCL.IRA.UKA.DE
  21.  
  22.  
  23.      Improvements in SYSTEM module
  24.      -----------------------------
  25.  
  26. o    REAL type software arithmetic operations now comply with ANSI/IEEE
  27.      Standard 754-1985 for Binary Floating Point Arithmetic [1,2] as much
  28.      as possible. Note that REAL arithmetic by design differs from the
  29.      standard in many ways, especially available numeric formats, value
  30.      set, and available operations. The rounding mode implemented here
  31.      is "round to nearest or even" as specified in the standard. Add,
  32.      Subtract, Multiply, Division, and Square Root deliver exact results
  33.      with regard to this rounding mode, as demanded by the standard.
  34.      Conversions from REAL to LONGINT and from EXTENDED to REAL use
  35.      rounding to nearest or even, as specified in the standard. Correct
  36.      implementation of above features was tested with the PARANOIA test
  37.      program [3]. The correctness of basic REAL arithmetic functions has
  38.      also been tested against the coprocessor/emulator EXTENDED format
  39.      with the program FUN1_TST. The EXTENDED format carries approximately
  40.      19 decimal digits of precision.
  41.  
  42. o    REAL arithmetic operations have been sped up. Speed up is fourfold for
  43.      SQRT (up to 22x on a 80386), twofold for FRAC and between 30% and 40%
  44.      for ARCTAN, LN, EXP and division (2.5x speed up for division on 80386).
  45.      Speed increase for SIN/COS functions is smaller (about 10%) since speed
  46.      was sacrificed in favor of more accurate results here. Overall numeric
  47.      processing power using REAL arithmetic increases by about 26% for an
  48.      8086 and by 38% for an 80386 as measured by the WHETSTONE benchmark [4,5].
  49.  
  50. o    Overall accuracy of REAL arithmetic transcendental functions has been
  51.      improved as indicated by Cody&Waite's ELEFUNT tests [6]: DLOG, DEXP,
  52.      DATAN, DSIN. Correct argument reduction ensures that relative error
  53.      over the whole argument range does not exceed 2.1e-12 for Exp, 3.1e-12
  54.      for Arctan, and 2.7e-12 for Ln. These values have been determined
  55.      by comparing the function returns of the REAL transcendental functions
  56.      to the values computed with a Cyrix 83D87 coprocessor for the EXTENDED
  57.      format. For Sin and Cos, relative error is also in the above range
  58.      when the argument is reasonably small (e.g. in range -100..100) and
  59.      not very close to an integer multiple of 0.5*Pi. Note that due to
  60.      accurracy requirements, the range of Sin/Cos arguments has been
  61.      reduced to -9.22337e18..9.22337e18. An error 207 (invalid float
  62.      operation) will be signaled for arguments outside this range.
  63.  
  64. o    Execution of coprocessor floating point computations using an 80287 or
  65.      80387 has been accelerated. For these coprocessors, NOPs will be inserted
  66.      before every floating point instruction converted from an emulator
  67.      interrupt instead of WAITs. As a result of this optimization, an
  68.      improvement in execution speed of 14% has been observed running the
  69.      Lawrence Livermore Loops (LLL) [7] on a Cyrix 83D87, the improvement
  70.      for the WHETSTONE benchmark on the 83D87 is 9.4%.
  71.  
  72. o    On a 80287XL, 80387, or 80846 the Sin and Cos functions take advantage
  73.      of the FSIN and FCOS instructions of these coprocessors, speeding up
  74.      these functions by almost a factor of two. Also, the Arctan function
  75.      takes advantage of the increased argument range of the FPATAN function.
  76.      These optimizations result in another 19% increase in WHETSTONE power,
  77.      so that the total combined speedup over the original library is 30%
  78.      for this benchmark.
  79.  
  80. o    STRING operations are faster, especially for longer strings. Most
  81.      dramatic increase is in the INSERT function, with execution times
  82.      reduced to up to one fourth compared with the original version of RTL.
  83.      Faster string operations cause 7% performance increase for the
  84.      DHRYSTONE [8,9] benchmark on a 8086.
  85.  
  86. o    Improved speed of random number generation. Random for REAL numbers
  87.      is 10% faster, Random for EXTENDED numbers is 5% faster, no speed
  88.      difference for Integer Random function.
  89.  
  90. o    Binary to decimal conversions used in Str and Write procedures have
  91.      been sped up by up to 70% for integers (BYTE, SHORTINT, INTEGER,
  92.      WORD, LONGINT), up to 5% for REAL numbers and about 3% for EXTENDED
  93.      numbers.
  94.  
  95. o    Improved speed of LONGINT arithmetic. Division enjoys fourfold
  96.      reduction of execution time on 8086, for an 80386 the speed up
  97.      factor is 6.7.
  98.  
  99. o    Several of the functions of the heap manager have been tuned,
  100.      giving up to 10% faster operation for these routines.
  101.  
  102. o    Set functions have been sped up by a few percent, but the add
  103.      variable range operation may be up to eight times as fast.
  104.  
  105. o    UPCASE function has been enhanced to support the complete IBM character
  106.      set. This means that characters ä,ü,ö,å,æ,é,ñ,ç are converted to upper
  107.      case by this function.
  108.  
  109. o    Several bugs have been fixed:
  110.  
  111.      Using REAL arithmetic in $N- mode, Trunc and Round could not produce
  112.      the smallest legal LONGINT number -2147483648. Arguments that should
  113.      result in this number caused a run time error 207 instead. Trunc/Round
  114.      now will return the correct result of -2147483648. Correct implementation
  115.      can be checked using the ROUNDTST program.
  116.  
  117.      The Random function could return 1.0 when compiled in the $N+ state,
  118.      although the specifications call for a return value 0 <= Random < 1.
  119.      This has been corrected. Return values from Random will be strictly
  120.      smaller than 1 now.
  121.  
  122.      GetDir now correctly returns a run-time error 15 (invalid drive)
  123.      when called with a non existent drive. Differing from the original,
  124.      it also signals all errors reported by DOS as run-time errors. E.g.
  125.      when applied to a floppy drive that does not contain a floppy, it
  126.      will now return run-time error 152 (drive not ready), where previously
  127.      it would incorrectly signal successful completion of the operation
  128.      (InOutRes = 0).
  129.  
  130.      LONGINT Read and Val routines now accept the smallest LONGINT
  131.      number -2147483648 as decimal input.
  132.  
  133.      For programs compiled with $N+, only true INFs are printed out as
  134.      INF where with the original library some NaNs are also printed as
  135.      INF. Correct operation can be tested with the INFBUG program.
  136.  
  137.      Addition/Subtraction of REAL arithmetic sometimes was unnecessarily
  138.      inaccurate due to incorrect handling of discarded digits of the
  139.      operand with smaller absolute value. This has been fixed with the
  140.      introduction of a completely new add/subtract routine.
  141.  
  142.      Multiplication of REAL numbers by small integers was inaccurate,
  143.      causing among others problems unnecessary inaccuracies in binary
  144.      <-> decimal conversion. This has been eliminated with the new
  145.      REAL arithmetic modules.
  146.  
  147.      REAL arithmetic EXP functions no longer signals overflow when
  148.      called with small arguments, but underflows to zero instead as it
  149.      should.
  150.  
  151.      Denormals in EXTENDED computations no longer cause invalid state
  152.      on 8087 coprocessor when being converted to true zeros. Consistency
  153.      between register contents and tag bits is now asserted. Removal of
  154.      this bug can be tested with the BUG87 program.
  155.  
  156.      Stack checking routine for programs compiled in the $S+ state now
  157.      reliably detects all stack overflows. This bug in TP 6.0 has also
  158.      been fixed in the second release of TP 6.0 by Borland, but Borland's
  159.      code is slower than the one used here.
  160.  
  161.      Program initialization routine now tries to prevent that programs
  162.      compiled with the $G+ (286 code generation) switch are run on 8086
  163.      and 8088. The checks done are not 100% safe, but catch most of these
  164.      cases, displaying the message "CPU > 8086 required" and aborting the
  165.      program instead of letting it crash. Note that this check lets programs
  166.      compiled with $G+ run on 80186 and V20/V30 processors, since these
  167.      have the ability to execute all 80286 real mode instructions produced
  168.      by Turbo Pascal.
  169.  
  170. o    Improved functionality only marginally increases overall code length
  171.      of the SYSTEM unit by 413 bytes (slightly more than 2%). This is due
  172.      to careful optimizing in numerous routines. Most programs compiled
  173.      with the new RTL will be smaller due to finer granularity of the RTL
  174.      modules. Savings are usually in the 1 KB range for reasonably large
  175.      programs.
  176.  
  177.  
  178.      Improvements in DOS module
  179.      --------------------------
  180.  
  181. o    Decreased code size by careful optimization of register usage in
  182.      some routines.
  183.  
  184.  
  185.      Improvements in CRT module
  186.      --------------------------
  187.  
  188. o    Bug fix in routine DirectWrite. The method used to prevent "snow"
  189.      when writing directly to a CGA graphics card was not entirely save.
  190.      When used in a heavily interrupted program (e.g. serial communication
  191.      as a background task), it would not always write during the time
  192.      when scanning was in the invisible parts of the screen. The method
  193.      used now is 100% save and is even faster, since it takes advantage
  194.      of the horizontal and vertical retrace periods, as opposed to the
  195.      old method which only used the horizontal retrace time. New routine
  196.      has been tested successfully on original IBM-CGA card.
  197.  
  198.  
  199.      Changes since version 1.3, dated 05-01-92
  200.      -----------------------------------------
  201.  
  202. o    Fixed bug that incorrectly set Test8087 variable for 8087/80287
  203.      coprocessors.
  204.  
  205. o    Fixed bug in Log function error return. It would return the biggest
  206.      possible REAL number before if called with an argument <= 0. It now
  207.      correctly raises error 207 (invalid floating-point operation).
  208.  
  209.  
  210.      Changes since version 1.2, dated 11-01-92
  211.      -----------------------------------------
  212.  
  213. o    Fixed bug in Rename procedure. Due to this error, Rename would not
  214.      work at all, but always return with error code 3 (path not found).
  215.      This has been corrected. This error was reported by ShinKuang Chang
  216.      (skchang@csemail.cropsci.ncsu.edu). Thanks!
  217.  
  218. o    Cleaned up the source code of the ELEFUNT test programs a bit. Since
  219.      these programs were ported from the FORTRAN original in a 'quick and
  220.      dirty' way, they were looking quite messy.
  221.  
  222.  
  223.      Changes since version 1.1 beta, dated 04-01-92
  224.      ----------------------------------------------
  225.  
  226. o    The Round and Trunc functions were unable to produce the smallest
  227.      LONGINT number, -2147483648. If a call to these functions resulted
  228.      in this number, an error was raised instead of returning the correct
  229.      result. This has been fixed. Valid inputs to the Trunc functions are
  230.      real numbers x for which -2147483649 < x < 2147483648 holds. Valid
  231.      inputs to the Round function are numbers x for which -2147483648.5
  232.      <= x < 2147483647.5 holds.
  233.  
  234.  
  235.      Changes since first beta release (version 1.0, dated 03-21-92)
  236.      --------------------------------------------------------------
  237.  
  238. o    Fixed bug in the routine that adds variable ranges to sets (as in
  239.      s := [foo..bar], where s is a set and foo and bar are variables of
  240.      the set's base type.
  241.  
  242. o    Switched back code in the REAL add/subtract routine to plain 8086
  243.      code. Forgot to remove the use386 flag when building code for the
  244.      original release 1.0 beta.
  245.  
  246.  
  247.      Changes since the alpha release
  248.      -------------------------------
  249.  
  250. o    There was an error in the 8087 float to string conversion in the
  251.      alpha release which has been fixed.
  252.  
  253. o    A bug in the coprocessor identification that sets the Test8087 variable
  254.      present in the alpha release has been fixed.
  255.  
  256. o    For string -> LONGINT conversion, it is now possible to input the
  257.      smallest LONGINT number -2147483648 in decimal.
  258.  
  259. o    An enhanced argument reduction has been implemented for REAL arithmetic
  260.      SIN, COS, and EXP function, delivering much more accurate results over
  261.      the complete argument range. This has slowed these functions down
  262.      somewhat, however, none of them runs slower than in the original TP 6.01
  263.      RTL. As a result of the new argument reduction, arguments to SIN and
  264.      COS are restricted to the range -3.37325e9..3.37325e9 now. Arguments to
  265.      these functions were previously unrestricted. For arguments outside the
  266.      range given, an error 207 will result. This is consistent with the
  267.      coprocessor/emulator generated SIN/COS functions, that also signal
  268.      error 207 for arguments out of range (-9.22337e18..9.22337e18).
  269.  
  270. o    SIN, COS, and ARCTAN functions compiled in the $N+ state will now use
  271.      the faster coprocessor instructions available on the 387 and 486 if
  272.      such a coprocessor/FPU is present.
  273.  
  274. o    A check has been included to prevent programs compiled with $G+ (286 code
  275.      generation) to run on a 8086.
  276.  
  277. o    The Random function has been fixed to return value strictly smaller than
  278.      1 when compiled with $N+.
  279.  
  280.  
  281.      References
  282.      ----------
  283.  
  284. [1]  IEEE: IEEE Standard for Binary Floating-Point Arithmetic.
  285.      SIGPLAN Notices, Vol. 22, No. 2, 1985, pp. 9-25
  286.  
  287. [2]  IEEE Standard for Binary Floating-Point Arithmetic.
  288.      ANSI/IEEE Std 754-1985.
  289.      New York, NY: Institute of Electrical and Electronics Engineers 1985
  290.  
  291. [3]  Karpinski, R.: Paranoia: A Floating-Point Benchmark.
  292.      Byte, February 1985, pp. 223-235
  293.  
  294. [4]  Curnow, H.J.; Wichmann, B.A.: A synthetic benchmark.
  295.      Computer Journal, Vol. 19, No. 1, 1976, pp. 43-49
  296.  
  297. [5]  Wichmannn, B.A.: Validation code for the Whetstone benchmark.
  298.      NPL Report DITC 107/88, National Physics Laboratory, UK, March 1988
  299.  
  300. [6]  Cody, W.J.; Waite, W.: Software Manual for the Elementary Functions.
  301.      Englewood Cliffs, NJ: Prentice Hall 1980
  302.  
  303. [7]  McMahon, H.H.: The Livermore Fortran Kernels: A Test of the Numerical
  304.      Performance Range.
  305.      Technical Report UCRL-53745, Lawrence Livermore National Laboratory,
  306.      December 1986, p. 179
  307.  
  308. [8]  Weicker, R.P.: Dhrystone: A Synthetic Systems Programming Benchmark.
  309.      Communications of the ACM, Vol. 27, No. 10, October 1984, pp. 1013-1030
  310.  
  311. [9]  Weicker, R.P.: Dhrystone Benchmark: Rationale for Version 2 and
  312.      Measurement Rules.
  313.      SIGPLAN Notices, Vol. 23, No. 8, August 1988, pp. 49-62
  314.  
  315.      Note:
  316.  
  317.      PARANOIA, DHRYSTONE, WHETSTONE, LLL, and ELEFUNT source code is
  318.      available from NETLIB@ORNL.GOV
  319.  
  320.